<template>
  <div>
    <ul>
      <li v-for="item in products">
        <nuxt-link :to="`/shopping/del?_id=${item._id}`">{{item.name}}</nuxt-link>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      products: []
    }
  },
  async beforeMount() {
    let res = await this.$store.dispatch('getProducts')
    if (res.success) this.products = res.data
  }
}
</script>
